{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 作业一"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 每行第一字母表示本人，其他字母他的朋友，找出有共同朋友的人，和共同朋友是谁，如何使用MapReduce来实现\n",
    "# ABCDEF\n",
    "# BACDE\n",
    "# CABE\n",
    "# DABE\n",
    "# EABCD\n",
    "# FA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#输入每个人的信息\n",
    "#map：key（首字母-每个字母），value(计数)\n",
    "#reduce：key（首字母-每个字母），value（计数包含两个字母的字符）\n",
    "#如果reduce的value==总人数-1，则这个人是所有人的共同朋友"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "persons =['ABCDEF','BACDE','CABE','DABE','EABCD','FA'] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "def map_friend(persons):\n",
    "    map_list = []\n",
    "    for person in persons: \n",
    "        #k为首字母\n",
    "        k = person[0]\n",
    "        map_dict = {}\n",
    "        for people in person:\n",
    "            key = k+'_'+people\n",
    "            map_dict[key] = people\n",
    "        #删除第一自己个人的值\n",
    "        map_dict.pop(k+'_'+k)\n",
    "        map_list.append(map_dict)\n",
    "    return map_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'A_B': 'B', 'A_C': 'C', 'A_D': 'D', 'A_E': 'E', 'A_F': 'F'},\n",
       " {'B_A': 'A', 'B_C': 'C', 'B_D': 'D', 'B_E': 'E'},\n",
       " {'C_A': 'A', 'C_B': 'B', 'C_E': 'E'},\n",
       " {'D_A': 'A', 'D_B': 'B', 'D_E': 'E'},\n",
       " {'E_A': 'A', 'E_B': 'B', 'E_C': 'C', 'E_D': 'D'},\n",
       " {'F_A': 'A'}]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "map_list = map_friend(persons)\n",
    "map_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'B': 4, 'C': 3, 'D': 3, 'E': 4, 'F': 1, 'A': 5}"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#计数，包含同样字符的键\n",
    "def reduce_friend(map_list):\n",
    "    reduce_list = []\n",
    "    reduce_dict = {}\n",
    "    for i in map_list:\n",
    "        for k,v in i.items():\n",
    "            keys = k.split('_')\n",
    "            key1 = keys[0]+keys[1]\n",
    "            key2 = keys[1]+keys[0]\n",
    "#             print('key1 = %s, key2 = %s'%(key1,key2))\n",
    "            #判断，是否同样字符\n",
    "#             value = v\n",
    "#             key = key1 \n",
    "            key = v\n",
    "#             if(key1 in reduce_dict or key2 in  reduce_dict):\n",
    "#                 key = key1 if(key1 in reduce_dict) else key2\n",
    "#                 value = reduce_dict.get(key)+1\n",
    "            value = 1\n",
    "            if(key in reduce_dict):\n",
    "                value = reduce_dict.get(key)+1\n",
    "            #只保存第一次存的key\n",
    "            reduce_dict[key] = value\n",
    "#             print(reduce_dict)\n",
    "#         reduce_list.append(reduce_dict)\n",
    "    return reduce_dict\n",
    "        \n",
    "reduce_friend(map_list)   \n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from functools import reduce\n",
    "friend_dict = reduce_friend(map_list)\n",
    "max_count = reduce(max,friend_dict.values())\n",
    "#对字典的值进行排序\n",
    "sorted(friend_dict,key = friend_dict.__getitem__)\n",
    "friend_dict.get('A')==len(persons)-1\n",
    "#A出现的次数等于总人数-1，所以A是所有人的朋友\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 作业二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 一个很大的2D矩阵，如果某点的值，由它周围某些点的值决定，例如（i，j）点 的值取当前周围8个点的平均值\n",
    "#生成矩阵\n",
    "import numpy as np\n",
    "np.random.seed(10)\n",
    "target_matrix = np.random.randint(1,100,(100,200))\n",
    "target_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "#根据给到的目标点和矩阵，得到周围点的值\n",
    "def get_around_spot_value(x,y,target_matrix):\n",
    "    #八个点(x-1,y-1),(x-1,y),(x-1,y+1),(x,y+1),(x,y-1),(x+1,y-1),(x+1,y),(x+1,y+1)\n",
    "    spot1,spot2,spot3,spot4,spot5,spot6,spot7,spot8 = 0,0,0,0,0,0,0,0\n",
    "    #x轴最大坐标\n",
    "    max_x = target_matrix.shape[0]-1\n",
    "    #y轴最大坐标\n",
    "    max_y = target_matrix.shape[1]-1\n",
    "    #将矩阵的四周填补0，免去判断和计算\n",
    "    target_matrix_new = np.pad(target_matrix,((1,1)))\n",
    "    x_new = x+1\n",
    "    y_new = y+1\n",
    "#     print(target_matrix_new.shape)\n",
    "    spot1 = target_matrix_new[x_new-1,y_new-1]\n",
    "    spot2 = target_matrix_new[x_new-1,y_new]\n",
    "    spot3 = target_matrix_new[x_new-1,y_new+1]\n",
    "    spot4 = target_matrix_new[x_new,y_new+1]\n",
    "    spot5 = target_matrix_new[x_new,y_new-1]\n",
    "    spot6 = target_matrix_new[x_new+1,y_new-1]\n",
    "    spot7 = target_matrix_new[x_new+1,y_new]\n",
    "    spot8 = target_matrix_new[x_new+1,y_new+1]\n",
    "    return [spot1,spot2,spot3,spot4,spot5,spot6,spot7,spot8]\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0, 0, 0, 16, 0, 0, 43, 35],\n",
       " [0, 0, 0, 65, 10, 43, 35, 41],\n",
       " [0, 0, 0, 29, 16, 35, 41, 47],\n",
       " [0, 0, 0, 90, 65, 41, 47, 33],\n",
       " [0, 0, 0, 94, 29, 47, 33, 95],\n",
       " [0, 0, 0, 30, 90, 33, 95, 87],\n",
       " [0, 0, 0, 9, 94, 95, 87, 59],\n",
       " [0, 0, 0, 74, 30, 87, 59, 70],\n",
       " [0, 0, 0, 1, 9, 59, 70, 46],\n",
       " [0, 0, 0, 41, 74, 70, 46, 19],\n",
       " [0, 0, 0, 37, 1, 46, 19, 51],\n",
       " [0, 0, 0, 17, 41, 19, 51, 45],\n",
       " [0, 0, 0, 12, 37, 51, 45, 2],\n",
       " [0, 0, 0, 55, 17, 45, 2, 64],\n",
       " [0, 0, 0, 89, 12, 2, 64, 78],\n",
       " [0, 0, 0, 63, 55, 64, 78, 19],\n",
       " [0, 0, 0, 34, 89, 78, 19, 28],\n",
       " [0, 0, 0, 73, 63, 19, 28, 84],\n",
       " [0, 0, 0, 79, 34, 28, 84, 38],\n",
       " [0, 0, 0, 50, 73, 84, 38, 72],\n",
       " [0, 0, 0, 52, 79, 38, 72, 89],\n",
       " [0, 0, 0, 55, 50, 72, 89, 16],\n",
       " [0, 0, 0, 78, 52, 89, 16, 56],\n",
       " [0, 0, 0, 70, 55, 16, 56, 7],\n",
       " [0, 0, 0, 14, 78, 56, 7, 45],\n",
       " [0, 0, 0, 26, 70, 7, 45, 10],\n",
       " [0, 0, 0, 14, 14, 45, 10, 51],\n",
       " [0, 0, 0, 93, 26, 10, 51, 1],\n",
       " [0, 0, 0, 87, 14, 51, 1, 45],\n",
       " [0, 0, 0, 31, 93, 1, 45, 69],\n",
       " [0, 0, 0, 31, 87, 45, 69, 15],\n",
       " [0, 0, 0, 90, 31, 69, 15, 5],\n",
       " [0, 0, 0, 13, 31, 15, 5, 7],\n",
       " [0, 0, 0, 66, 90, 5, 7, 43],\n",
       " [0, 0, 0, 32, 13, 7, 43, 74],\n",
       " [0, 0, 0, 58, 66, 43, 74, 45],\n",
       " [0, 0, 0, 37, 32, 74, 45, 91],\n",
       " [0, 0, 0, 28, 58, 45, 91, 39],\n",
       " [0, 0, 0, 19, 37, 91, 39, 21],\n",
       " [0, 0, 0, 94, 28, 39, 21, 10],\n",
       " [0, 0, 0, 78, 19, 21, 10, 41],\n",
       " [0, 0, 0, 23, 94, 10, 41, 17],\n",
       " [0, 0, 0, 24, 78, 41, 17, 76],\n",
       " [0, 0, 0, 95, 23, 17, 76, 40],\n",
       " [0, 0, 0, 12, 24, 76, 40, 59],\n",
       " [0, 0, 0, 29, 95, 40, 59, 82],\n",
       " [0, 0, 0, 75, 12, 59, 82, 40],\n",
       " [0, 0, 0, 89, 29, 82, 40, 50],\n",
       " [0, 0, 0, 10, 75, 40, 50, 98],\n",
       " [0, 0, 0, 16, 89, 50, 98, 12],\n",
       " [0, 0, 0, 19, 10, 98, 12, 79],\n",
       " [0, 0, 0, 81, 16, 12, 79, 80],\n",
       " [0, 0, 0, 72, 19, 79, 80, 22],\n",
       " [0, 0, 0, 89, 81, 80, 22, 70],\n",
       " [0, 0, 0, 12, 72, 22, 70, 49],\n",
       " [0, 0, 0, 18, 89, 70, 49, 61],\n",
       " [0, 0, 0, 47, 12, 49, 61, 59],\n",
       " [0, 0, 0, 8, 18, 61, 59, 14],\n",
       " [0, 0, 0, 76, 47, 59, 14, 4],\n",
       " [0, 0, 0, 29, 8, 14, 4, 32],\n",
       " [0, 0, 0, 34, 76, 4, 32, 77],\n",
       " [0, 0, 0, 85, 29, 32, 77, 88],\n",
       " [0, 0, 0, 97, 34, 77, 88, 18],\n",
       " [0, 0, 0, 89, 85, 88, 18, 30],\n",
       " [0, 0, 0, 45, 97, 18, 30, 70],\n",
       " [0, 0, 0, 6, 89, 30, 70, 51],\n",
       " [0, 0, 0, 5, 45, 70, 51, 52],\n",
       " [0, 0, 0, 72, 6, 51, 52, 21],\n",
       " [0, 0, 0, 89, 5, 52, 21, 6],\n",
       " [0, 0, 0, 89, 72, 21, 6, 71],\n",
       " [0, 0, 0, 51, 89, 6, 71, 62],\n",
       " [0, 0, 0, 55, 89, 71, 62, 17],\n",
       " [0, 0, 0, 35, 51, 62, 17, 75],\n",
       " [0, 0, 0, 16, 55, 17, 75, 5],\n",
       " [0, 0, 0, 78, 35, 75, 5, 23],\n",
       " [0, 0, 0, 89, 16, 5, 23, 20],\n",
       " [0, 0, 0, 16, 78, 23, 20, 86],\n",
       " [0, 0, 0, 7, 89, 20, 86, 74],\n",
       " [0, 0, 0, 86, 16, 86, 74, 36],\n",
       " [0, 0, 0, 23, 7, 74, 36, 36],\n",
       " [0, 0, 0, 12, 86, 36, 36, 12],\n",
       " [0, 0, 0, 13, 23, 36, 12, 42],\n",
       " [0, 0, 0, 93, 12, 12, 42, 55],\n",
       " [0, 0, 0, 97, 13, 42, 55, 83],\n",
       " [0, 0, 0, 63, 93, 55, 83, 20],\n",
       " [0, 0, 0, 58, 97, 83, 20, 42],\n",
       " [0, 0, 0, 80, 63, 20, 42, 82],\n",
       " [0, 0, 0, 43, 58, 42, 82, 62],\n",
       " [0, 0, 0, 58, 80, 82, 62, 11],\n",
       " [0, 0, 0, 98, 43, 62, 11, 37],\n",
       " [0, 0, 0, 51, 58, 11, 37, 1],\n",
       " [0, 0, 0, 46, 98, 37, 1, 31],\n",
       " [0, 0, 0, 41, 51, 1, 31, 63],\n",
       " [0, 0, 0, 90, 46, 31, 63, 86],\n",
       " [0, 0, 0, 74, 41, 63, 86, 33],\n",
       " [0, 0, 0, 38, 90, 86, 33, 82],\n",
       " [0, 0, 0, 1, 74, 33, 82, 14],\n",
       " [0, 0, 0, 19, 38, 82, 14, 68],\n",
       " [0, 0, 0, 24, 1, 14, 68, 32],\n",
       " [0, 0, 0, 4, 19, 68, 32, 33],\n",
       " [0, 0, 0, 30, 24, 32, 33, 97],\n",
       " [0, 0, 0, 17, 4, 33, 97, 39],\n",
       " [0, 0, 0, 85, 30, 97, 39, 38],\n",
       " [0, 0, 0, 83, 17, 39, 38, 80],\n",
       " [0, 0, 0, 15, 85, 38, 80, 60],\n",
       " [0, 0, 0, 52, 83, 80, 60, 21],\n",
       " [0, 0, 0, 80, 15, 60, 21, 32],\n",
       " [0, 0, 0, 18, 52, 21, 32, 90],\n",
       " [0, 0, 0, 51, 80, 32, 90, 1],\n",
       " [0, 0, 0, 54, 18, 90, 1, 97],\n",
       " [0, 0, 0, 26, 51, 1, 97, 26],\n",
       " [0, 0, 0, 49, 54, 97, 26, 64],\n",
       " [0, 0, 0, 18, 26, 26, 64, 60],\n",
       " [0, 0, 0, 33, 49, 64, 60, 3],\n",
       " [0, 0, 0, 82, 18, 60, 3, 31],\n",
       " [0, 0, 0, 81, 33, 3, 31, 18],\n",
       " [0, 0, 0, 42, 82, 31, 18, 60],\n",
       " [0, 0, 0, 91, 81, 18, 60, 71],\n",
       " [0, 0, 0, 13, 42, 60, 71, 64],\n",
       " [0, 0, 0, 31, 91, 71, 64, 87],\n",
       " [0, 0, 0, 82, 13, 64, 87, 30],\n",
       " [0, 0, 0, 18, 31, 87, 30, 72],\n",
       " [0, 0, 0, 17, 82, 30, 72, 93],\n",
       " [0, 0, 0, 1, 18, 72, 93, 20],\n",
       " [0, 0, 0, 32, 17, 93, 20, 1],\n",
       " [0, 0, 0, 74, 1, 20, 1, 8],\n",
       " [0, 0, 0, 65, 32, 1, 8, 94],\n",
       " [0, 0, 0, 39, 74, 8, 94, 43],\n",
       " [0, 0, 0, 23, 65, 94, 43, 88],\n",
       " [0, 0, 0, 97, 39, 43, 88, 58],\n",
       " [0, 0, 0, 67, 23, 88, 58, 81],\n",
       " [0, 0, 0, 68, 97, 58, 81, 3],\n",
       " [0, 0, 0, 63, 67, 81, 3, 35],\n",
       " [0, 0, 0, 96, 68, 3, 35, 59],\n",
       " [0, 0, 0, 28, 63, 35, 59, 77],\n",
       " [0, 0, 0, 83, 96, 59, 77, 11],\n",
       " [0, 0, 0, 63, 28, 77, 11, 80],\n",
       " [0, 0, 0, 78, 83, 11, 80, 33],\n",
       " [0, 0, 0, 49, 63, 80, 33, 70],\n",
       " [0, 0, 0, 94, 78, 33, 70, 92],\n",
       " [0, 0, 0, 76, 49, 70, 92, 17],\n",
       " [0, 0, 0, 87, 94, 92, 17, 6],\n",
       " [0, 0, 0, 38, 76, 17, 6, 64],\n",
       " [0, 0, 0, 12, 87, 6, 64, 84],\n",
       " [0, 0, 0, 22, 38, 64, 84, 76],\n",
       " [0, 0, 0, 34, 12, 84, 76, 43],\n",
       " [0, 0, 0, 96, 22, 76, 43, 39],\n",
       " [0, 0, 0, 44, 34, 43, 39, 58],\n",
       " [0, 0, 0, 89, 96, 39, 58, 8],\n",
       " [0, 0, 0, 97, 44, 58, 8, 89],\n",
       " [0, 0, 0, 74, 89, 8, 89, 97],\n",
       " [0, 0, 0, 41, 97, 89, 97, 39],\n",
       " [0, 0, 0, 44, 74, 97, 39, 49],\n",
       " [0, 0, 0, 91, 41, 39, 49, 28],\n",
       " [0, 0, 0, 72, 44, 49, 28, 65],\n",
       " [0, 0, 0, 9, 91, 28, 65, 50],\n",
       " [0, 0, 0, 86, 72, 65, 50, 91],\n",
       " [0, 0, 0, 73, 9, 50, 91, 10],\n",
       " [0, 0, 0, 29, 86, 91, 10, 28],\n",
       " [0, 0, 0, 31, 73, 10, 28, 53],\n",
       " [0, 0, 0, 90, 29, 28, 53, 91],\n",
       " [0, 0, 0, 26, 31, 53, 91, 58],\n",
       " [0, 0, 0, 79, 90, 91, 58, 49],\n",
       " [0, 0, 0, 82, 26, 58, 49, 24],\n",
       " [0, 0, 0, 86, 79, 49, 24, 26],\n",
       " [0, 0, 0, 63, 82, 24, 26, 20],\n",
       " [0, 0, 0, 14, 86, 26, 20, 49],\n",
       " [0, 0, 0, 42, 63, 20, 49, 98],\n",
       " [0, 0, 0, 34, 14, 49, 98, 77],\n",
       " [0, 0, 0, 5, 42, 98, 77, 76],\n",
       " [0, 0, 0, 88, 34, 77, 76, 94],\n",
       " [0, 0, 0, 95, 5, 76, 94, 31],\n",
       " [0, 0, 0, 29, 88, 94, 31, 32],\n",
       " [0, 0, 0, 40, 95, 31, 32, 29],\n",
       " [0, 0, 0, 92, 29, 32, 29, 80],\n",
       " [0, 0, 0, 10, 40, 29, 80, 85],\n",
       " [0, 0, 0, 8, 92, 80, 85, 22],\n",
       " [0, 0, 0, 23, 10, 85, 22, 85],\n",
       " [0, 0, 0, 33, 8, 22, 85, 47],\n",
       " [0, 0, 0, 4, 23, 85, 47, 47],\n",
       " [0, 0, 0, 10, 33, 47, 47, 46],\n",
       " [0, 0, 0, 53, 4, 47, 46, 95],\n",
       " [0, 0, 0, 77, 10, 46, 95, 85],\n",
       " [0, 0, 0, 69, 53, 95, 85, 21],\n",
       " [0, 0, 0, 31, 77, 85, 21, 50],\n",
       " [0, 0, 0, 71, 69, 21, 50, 34],\n",
       " [0, 0, 0, 75, 31, 50, 34, 3],\n",
       " [0, 0, 0, 31, 71, 34, 3, 98],\n",
       " [0, 0, 0, 10, 75, 3, 98, 98],\n",
       " [0, 0, 0, 3, 31, 98, 98, 99],\n",
       " [0, 0, 0, 66, 10, 98, 99, 13],\n",
       " [0, 0, 0, 14, 3, 99, 13, 83],\n",
       " [0, 0, 0, 76, 66, 13, 83, 78],\n",
       " [0, 0, 0, 53, 14, 83, 78, 67],\n",
       " [0, 0, 0, 6, 76, 78, 67, 38],\n",
       " [0, 0, 0, 94, 53, 67, 38, 32],\n",
       " [0, 0, 0, 85, 6, 38, 32, 57],\n",
       " [0, 0, 0, 49, 94, 32, 57, 82],\n",
       " [0, 0, 0, 63, 85, 57, 82, 88],\n",
       " [0, 0, 0, 0, 49, 82, 88, 0],\n",
       " [0, 10, 16, 35, 0, 0, 82, 56],\n",
       " [10, 16, 65, 41, 43, 82, 56, 98],\n",
       " [16, 65, 29, 47, 35, 56, 98, 75],\n",
       " [65, 29, 90, 33, 41, 98, 75, 16],\n",
       " [29, 90, 94, 95, 47, 75, 16, 80],\n",
       " [90, 94, 30, 87, 33, 16, 80, 81],\n",
       " [94, 30, 9, 59, 95, 80, 81, 39],\n",
       " [30, 9, 74, 70, 87, 81, 39, 56],\n",
       " [9, 74, 1, 46, 59, 39, 56, 50],\n",
       " [74, 1, 41, 19, 70, 56, 50, 91],\n",
       " [1, 41, 37, 51, 46, 50, 91, 3],\n",
       " [41, 37, 17, 45, 19, 91, 3, 71],\n",
       " [37, 17, 12, 2, 51, 3, 71, 98],\n",
       " [17, 12, 55, 64, 45, 71, 98, 6],\n",
       " [12, 55, 89, 78, 2, 98, 6, 73],\n",
       " [55, 89, 63, 19, 64, 6, 73, 30],\n",
       " [89, 63, 34, 28, 78, 73, 30, 20],\n",
       " [63, 34, 73, 84, 19, 30, 20, 26],\n",
       " [34, 73, 79, 38, 28, 20, 26, 16],\n",
       " [73, 79, 50, 72, 84, 26, 16, 55],\n",
       " [79, 50, 52, 89, 38, 16, 55, 97],\n",
       " [50, 52, 55, 16, 72, 55, 97, 83],\n",
       " [52, 55, 78, 56, 89, 97, 83, 57],\n",
       " [55, 78, 70, 7, 16, 83, 57, 42],\n",
       " [78, 70, 14, 45, 56, 57, 42, 91],\n",
       " [70, 14, 26, 10, 7, 42, 91, 27],\n",
       " [14, 26, 14, 51, 45, 91, 27, 75],\n",
       " [26, 14, 93, 1, 10, 27, 75, 9],\n",
       " [14, 93, 87, 45, 51, 75, 9, 93],\n",
       " [93, 87, 31, 69, 1, 9, 93, 33],\n",
       " [87, 31, 31, 15, 45, 93, 33, 72],\n",
       " [31, 31, 90, 5, 69, 33, 72, 88],\n",
       " [31, 90, 13, 7, 15, 72, 88, 69],\n",
       " [90, 13, 66, 43, 5, 88, 69, 87],\n",
       " [13, 66, 32, 74, 7, 69, 87, 15],\n",
       " [66, 32, 58, 45, 43, 87, 15, 36],\n",
       " [32, 58, 37, 91, 74, 15, 36, 85],\n",
       " [58, 37, 28, 39, 45, 36, 85, 38],\n",
       " [37, 28, 19, 21, 91, 85, 38, 63],\n",
       " [28, 19, 94, 10, 39, 38, 63, 68],\n",
       " [19, 94, 78, 41, 21, 63, 68, 15],\n",
       " [94, 78, 23, 17, 10, 68, 15, 38],\n",
       " [78, 23, 24, 76, 41, 15, 38, 58],\n",
       " [23, 24, 95, 40, 17, 38, 58, 79],\n",
       " [24, 95, 12, 59, 76, 58, 79, 35],\n",
       " [95, 12, 29, 82, 40, 79, 35, 52],\n",
       " [12, 29, 75, 40, 59, 35, 52, 51],\n",
       " [29, 75, 89, 50, 82, 52, 51, 51],\n",
       " [75, 89, 10, 98, 40, 51, 51, 86],\n",
       " [89, 10, 16, 12, 50, 51, 86, 15],\n",
       " [10, 16, 19, 79, 98, 86, 15, 53],\n",
       " [16, 19, 81, 80, 12, 15, 53, 31],\n",
       " [19, 81, 72, 22, 79, 53, 31, 82],\n",
       " [81, 72, 89, 70, 80, 31, 82, 11],\n",
       " [72, 89, 12, 49, 22, 82, 11, 62],\n",
       " [89, 12, 18, 61, 70, 11, 62, 24],\n",
       " [12, 18, 47, 59, 49, 62, 24, 2],\n",
       " [18, 47, 8, 14, 61, 24, 2, 29],\n",
       " [47, 8, 76, 4, 59, 2, 29, 59],\n",
       " [8, 76, 29, 32, 14, 29, 59, 11],\n",
       " [76, 29, 34, 77, 4, 59, 11, 12],\n",
       " [29, 34, 85, 88, 32, 11, 12, 2],\n",
       " [34, 85, 97, 18, 77, 12, 2, 83],\n",
       " [85, 97, 89, 30, 88, 2, 83, 35],\n",
       " [97, 89, 45, 70, 18, 83, 35, 12],\n",
       " [89, 45, 6, 51, 30, 35, 12, 47],\n",
       " [45, 6, 5, 52, 70, 12, 47, 75],\n",
       " [6, 5, 72, 21, 51, 47, 75, 37],\n",
       " [5, 72, 89, 6, 52, 75, 37, 7],\n",
       " [72, 89, 89, 71, 21, 37, 7, 64],\n",
       " [89, 89, 51, 62, 6, 7, 64, 61],\n",
       " [89, 51, 55, 17, 71, 64, 61, 4],\n",
       " [51, 55, 35, 75, 62, 61, 4, 51],\n",
       " [55, 35, 16, 5, 17, 4, 51, 60],\n",
       " [35, 16, 78, 23, 75, 51, 60, 35],\n",
       " [16, 78, 89, 20, 5, 60, 35, 22],\n",
       " [78, 89, 16, 86, 23, 35, 22, 17],\n",
       " [89, 16, 7, 74, 20, 22, 17, 19],\n",
       " [16, 7, 86, 36, 86, 17, 19, 62],\n",
       " [7, 86, 23, 36, 74, 19, 62, 55],\n",
       " [86, 23, 12, 12, 36, 62, 55, 61],\n",
       " [23, 12, 13, 42, 36, 55, 61, 22],\n",
       " [12, 13, 93, 55, 12, 61, 22, 88],\n",
       " [13, 93, 97, 83, 42, 22, 88, 84],\n",
       " [93, 97, 63, 20, 55, 88, 84, 72],\n",
       " [97, 63, 58, 42, 83, 84, 72, 17],\n",
       " [63, 58, 80, 82, 20, 72, 17, 68],\n",
       " [58, 80, 43, 62, 42, 17, 68, 39],\n",
       " [80, 43, 58, 11, 82, 68, 39, 28],\n",
       " [43, 58, 98, 37, 62, 39, 28, 97],\n",
       " [58, 98, 51, 1, 11, 28, 97, 88],\n",
       " [98, 51, 46, 31, 37, 97, 88, 99],\n",
       " [51, 46, 41, 63, 1, 88, 99, 90],\n",
       " [46, 41, 90, 86, 31, 99, 90, 17],\n",
       " [41, 90, 74, 33, 63, 90, 17, 83],\n",
       " [90, 74, 38, 82, 86, 17, 83, 20],\n",
       " [74, 38, 1, 14, 33, 83, 20, 97],\n",
       " [38, 1, 19, 68, 82, 20, 97, 51],\n",
       " [1, 19, 24, 32, 14, 97, 51, 89],\n",
       " [19, 24, 4, 33, 68, 51, 89, 9],\n",
       " [24, 4, 30, 97, 32, 89, 9, 87],\n",
       " [4, 30, 17, 39, 33, 9, 87, 76],\n",
       " [30, 17, 85, 38, 97, 87, 76, 73],\n",
       " [17, 85, 83, 80, 39, 76, 73, 89],\n",
       " [85, 83, 15, 60, 38, 73, 89, 27],\n",
       " [83, 15, 52, 21, 80, 89, 27, 81],\n",
       " [15, 52, 80, 32, 60, 27, 81, 29],\n",
       " [52, 80, 18, 90, 21, 81, 29, 27],\n",
       " [80, 18, 51, 1, 32, 29, 27, 95],\n",
       " [18, 51, 54, 97, 90, 27, 95, 2],\n",
       " [51, 54, 26, 26, 1, 95, 2, 92],\n",
       " [54, 26, 49, 64, 97, 2, 92, 3],\n",
       " [26, 49, 18, 60, 26, 92, 3, 89],\n",
       " [49, 18, 33, 3, 64, 3, 89, 61],\n",
       " [18, 33, 82, 31, 60, 89, 61, 52],\n",
       " [33, 82, 81, 18, 3, 61, 52, 14],\n",
       " [82, 81, 42, 60, 31, 52, 14, 78],\n",
       " [81, 42, 91, 71, 18, 14, 78, 26],\n",
       " [42, 91, 13, 64, 60, 78, 26, 62],\n",
       " [91, 13, 31, 87, 71, 26, 62, 41],\n",
       " [13, 31, 82, 30, 64, 62, 41, 7],\n",
       " [31, 82, 18, 72, 87, 41, 7, 38],\n",
       " [82, 18, 17, 93, 30, 7, 38, 82],\n",
       " [18, 17, 1, 20, 72, 38, 82, 71],\n",
       " [17, 1, 32, 1, 93, 82, 71, 39],\n",
       " [1, 32, 74, 8, 20, 71, 39, 95],\n",
       " [32, 74, 65, 94, 1, 39, 95, 3],\n",
       " [74, 65, 39, 43, 8, 95, 3, 37],\n",
       " [65, 39, 23, 88, 94, 3, 37, 75],\n",
       " [39, 23, 97, 58, 43, 37, 75, 57],\n",
       " [23, 97, 67, 81, 88, 75, 57, 26],\n",
       " [97, 67, 68, 3, 58, 57, 26, 83],\n",
       " [67, 68, 63, 35, 81, 26, 83, 97],\n",
       " [68, 63, 96, 59, 3, 83, 97, 59],\n",
       " [63, 96, 28, 77, 35, 97, 59, 17],\n",
       " [96, 28, 83, 11, 59, 59, 17, 87],\n",
       " [28, 83, 63, 80, 77, 17, 87, 41],\n",
       " [83, 63, 78, 33, 11, 87, 41, 96],\n",
       " [63, 78, 49, 70, 80, 41, 96, 39],\n",
       " [78, 49, 94, 92, 33, 96, 39, 5],\n",
       " [49, 94, 76, 17, 70, 39, 5, 24],\n",
       " [94, 76, 87, 6, 92, 5, 24, 59],\n",
       " [76, 87, 38, 64, 17, 24, 59, 40],\n",
       " [87, 38, 12, 84, 6, 59, 40, 1],\n",
       " [38, 12, 22, 76, 64, 40, 1, 39],\n",
       " [12, 22, 34, 43, 84, 1, 39, 79],\n",
       " [22, 34, 96, 39, 76, 39, 79, 74],\n",
       " [34, 96, 44, 58, 43, 79, 74, 27],\n",
       " [96, 44, 89, 8, 39, 74, 27, 82],\n",
       " [44, 89, 97, 89, 58, 27, 82, 6],\n",
       " [89, 97, 74, 97, 8, 82, 6, 2],\n",
       " [97, 74, 41, 39, 89, 6, 2, 13],\n",
       " [74, 41, 44, 49, 97, 2, 13, 87],\n",
       " [41, 44, 91, 28, 39, 13, 87, 1],\n",
       " [44, 91, 72, 65, 49, 87, 1, 72],\n",
       " [91, 72, 9, 50, 28, 1, 72, 1],\n",
       " [72, 9, 86, 91, 65, 72, 1, 59],\n",
       " [9, 86, 73, 10, 50, 1, 59, 27],\n",
       " [86, 73, 29, 28, 91, 59, 27, 20],\n",
       " [73, 29, 31, 53, 10, 27, 20, 83],\n",
       " [29, 31, 90, 91, 28, 20, 83, 72],\n",
       " [31, 90, 26, 58, 53, 83, 72, 6],\n",
       " [90, 26, 79, 49, 91, 72, 6, 30],\n",
       " [26, 79, 82, 24, 58, 6, 30, 2],\n",
       " [79, 82, 86, 26, 49, 30, 2, 62],\n",
       " [82, 86, 63, 20, 24, 2, 62, 29],\n",
       " [86, 63, 14, 49, 26, 62, 29, 7],\n",
       " [63, 14, 42, 98, 20, 29, 7, 86],\n",
       " [14, 42, 34, 77, 49, 7, 86, 88],\n",
       " [42, 34, 5, 76, 98, 86, 88, 92],\n",
       " [34, 5, 88, 94, 77, 88, 92, 4],\n",
       " [5, 88, 95, 31, 76, 92, 4, 7],\n",
       " [88, 95, 29, 32, 94, 4, 7, 99],\n",
       " [95, 29, 40, 29, 31, 7, 99, 92],\n",
       " [29, 40, 92, 80, 32, 99, 92, 55],\n",
       " [40, 92, 10, 85, 29, 92, 55, 9],\n",
       " [92, 10, 8, 22, 80, 55, 9, 73],\n",
       " [10, 8, 23, 85, 85, 9, 73, 11],\n",
       " [8, 23, 33, 47, 22, 73, 11, 58],\n",
       " [23, 33, 4, 47, 85, 11, 58, 85],\n",
       " [33, 4, 10, 46, 47, 58, 85, 5],\n",
       " [4, 10, 53, 95, 47, 85, 5, 88],\n",
       " [10, 53, 77, 85, 46, 5, 88, 66],\n",
       " [53, 77, 69, 21, 95, 88, 66, 8],\n",
       " [77, 69, 31, 50, 85, 66, 8, 73],\n",
       " [69, 31, 71, 34, 21, 8, 73, 44],\n",
       " [31, 71, 75, 3, 50, 73, 44, 49],\n",
       " [71, 75, 31, 98, 34, 44, 49, 89],\n",
       " [75, 31, 10, 98, 3, 49, 89, 43],\n",
       " [31, 10, 3, 99, 98, 89, 43, 22],\n",
       " [10, 3, 66, 13, 98, 43, 22, 88],\n",
       " [3, 66, 14, 83, 99, 22, 88, 19],\n",
       " [66, 14, 76, 78, 13, 88, 19, 20],\n",
       " [14, 76, 53, 67, 83, 19, 20, 79],\n",
       " [76, 53, 6, 38, 78, 20, 79, 33],\n",
       " [53, 6, 94, 32, 67, 79, 33, 24],\n",
       " [6, 94, 85, 57, 38, 33, 24, 88],\n",
       " [94, 85, 49, 82, 32, 24, 88, 48],\n",
       " [85, 49, 63, 88, 57, 88, 48, 57],\n",
       " [49, 63, 0, 0, 82, 48, 57, 0],\n",
       " [0, 43, 35, 56, 0, 0, 48, 35],\n",
       " [43, 35, 41, 98, 82, 48, 35, 97],\n",
       " [35, 41, 47, 75, 56, 35, 97, 18],\n",
       " [41, 47, 33, 16, 98, 97, 18, 97],\n",
       " [47, 33, 95, 80, 75, 18, 97, 97],\n",
       " [33, 95, 87, 81, 16, 97, 97, 19],\n",
       " [95, 87, 59, 39, 80, 97, 19, 69],\n",
       " [87, 59, 70, 56, 81, 19, 69, 3],\n",
       " [59, 70, 46, 50, 39, 69, 3, 16],\n",
       " [70, 46, 19, 91, 56, 3, 16, 42],\n",
       " [46, 19, 51, 3, 50, 16, 42, 72],\n",
       " [19, 51, 45, 71, 91, 42, 72, 98],\n",
       " [51, 45, 2, 98, 3, 72, 98, 52],\n",
       " [45, 2, 64, 6, 71, 98, 52, 70],\n",
       " [2, 64, 78, 73, 98, 52, 70, 37],\n",
       " [64, 78, 19, 30, 6, 70, 37, 75],\n",
       " [78, 19, 28, 20, 73, 37, 75, 29],\n",
       " [19, 28, 84, 26, 30, 75, 29, 82],\n",
       " [28, 84, 38, 16, 20, 29, 82, 56],\n",
       " [84, 38, 72, 55, 26, 82, 56, 73],\n",
       " [38, 72, 89, 97, 16, 56, 73, 7],\n",
       " [72, 89, 16, 83, 55, 73, 7, 17],\n",
       " [89, 16, 56, 57, 97, 7, 17, 21],\n",
       " [16, 56, 7, 42, 83, 17, 21, 4],\n",
       " [56, 7, 45, 91, 57, 21, 4, 49],\n",
       " [7, 45, 10, 27, 42, 4, 49, 77],\n",
       " [45, 10, 51, 75, 91, 49, 77, 77],\n",
       " [10, 51, 1, 9, 27, 77, 77, 59],\n",
       " [51, 1, 45, 93, 75, 77, 59, 66],\n",
       " [1, 45, 69, 33, 9, 59, 66, 83],\n",
       " [45, 69, 15, 72, 93, 66, 83, 24],\n",
       " [69, 15, 5, 88, 33, 83, 24, 25],\n",
       " [15, 5, 7, 69, 72, 24, 25, 73],\n",
       " [5, 7, 43, 87, 88, 25, 73, 55],\n",
       " [7, 43, 74, 15, 69, 73, 55, 81],\n",
       " [43, 74, 45, 36, 87, 55, 81, 22],\n",
       " [74, 45, 91, 85, 15, 81, 22, 55],\n",
       " [45, 91, 39, 38, 36, 22, 55, 20],\n",
       " [91, 39, 21, 63, 85, 55, 20, 96],\n",
       " [39, 21, 10, 68, 38, 20, 96, 55],\n",
       " [21, 10, 41, 15, 63, 96, 55, 4],\n",
       " [10, 41, 17, 38, 68, 55, 4, 99],\n",
       " [41, 17, 76, 58, 15, 4, 99, 26],\n",
       " [17, 76, 40, 79, 38, 99, 26, 42],\n",
       " [76, 40, 59, 35, 58, 26, 42, 15],\n",
       " [40, 59, 82, 52, 79, 42, 15, 74],\n",
       " [59, 82, 40, 51, 35, 15, 74, 72],\n",
       " [82, 40, 50, 51, 52, 74, 72, 39],\n",
       " [40, 50, 98, 86, 51, 72, 39, 50],\n",
       " [50, 98, 12, 15, 51, 39, 50, 23],\n",
       " [98, 12, 79, 53, 86, 50, 23, 98],\n",
       " [12, 79, 80, 31, 15, 23, 98, 48],\n",
       " [79, 80, 22, 82, 53, 98, 48, 32],\n",
       " [80, 22, 70, 11, 31, 48, 32, 47],\n",
       " [22, 70, 49, 62, 82, 32, 47, 99],\n",
       " [70, 49, 61, 24, 11, 47, 99, 6],\n",
       " [49, 61, 59, 2, 62, 99, 6, 15],\n",
       " [61, 59, 14, 29, 24, 6, 15, 77],\n",
       " [59, 14, 4, 59, 2, 15, 77, 17],\n",
       " [14, 4, 32, 11, 29, 77, 17, 93],\n",
       " [4, 32, 77, 12, 59, 17, 93, 21],\n",
       " [32, 77, 88, 2, 11, 93, 21, 83],\n",
       " [77, 88, 18, 83, 12, 21, 83, 10],\n",
       " [88, 18, 30, 35, 2, 83, 10, 57],\n",
       " [18, 30, 70, 12, 83, 10, 57, 38],\n",
       " [30, 70, 51, 47, 35, 57, 38, 99],\n",
       " [70, 51, 52, 75, 12, 38, 99, 7],\n",
       " [51, 52, 21, 37, 47, 99, 7, 31],\n",
       " [52, 21, 6, 7, 75, 7, 31, 68],\n",
       " [21, 6, 71, 64, 37, 31, 68, 72],\n",
       " [6, 71, 62, 61, 7, 68, 72, 71],\n",
       " [71, 62, 17, 4, 64, 72, 71, 54],\n",
       " [62, 17, 75, 51, 61, 71, 54, 57],\n",
       " [17, 75, 5, 60, 4, 54, 57, 14],\n",
       " [75, 5, 23, 35, 51, 57, 14, 11],\n",
       " [5, 23, 20, 22, 60, 14, 11, 61],\n",
       " [23, 20, 86, 17, 35, 11, 61, 34],\n",
       " [20, 86, 74, 19, 22, 61, 34, 43],\n",
       " [86, 74, 36, 62, 17, 34, 43, 1],\n",
       " [74, 36, 36, 55, 19, 43, 1, 89],\n",
       " [36, 36, 12, 61, 62, 1, 89, 55],\n",
       " [36, 12, 42, 22, 55, 89, 55, 57],\n",
       " [12, 42, 55, 88, 61, 55, 57, 37],\n",
       " [42, 55, 83, 84, 22, 57, 37, 88],\n",
       " [55, 83, 20, 72, 88, 37, 88, 67],\n",
       " [83, 20, 42, 17, 84, 88, 67, 6],\n",
       " [20, 42, 82, 68, 72, 67, 6, 56],\n",
       " [42, 82, 62, 39, 17, 6, 56, 18],\n",
       " [82, 62, 11, 28, 68, 56, 18, 2],\n",
       " [62, 11, 37, 97, 39, 18, 2, 74],\n",
       " [11, 37, 1, 88, 28, 2, 74, 52],\n",
       " [37, 1, 31, 99, 97, 74, 52, 78],\n",
       " [1, 31, 63, 90, 88, 52, 78, 14],\n",
       " [31, 63, 86, 17, 99, 78, 14, 98],\n",
       " [63, 86, 33, 83, 90, 14, 98, 8],\n",
       " [86, 33, 82, 20, 17, 98, 8, 27],\n",
       " [33, 82, 14, 97, 83, 8, 27, 11],\n",
       " [82, 14, 68, 51, 20, 27, 11, 39],\n",
       " [14, 68, 32, 89, 97, 11, 39, 10],\n",
       " [68, 32, 33, 9, 51, 39, 10, 99],\n",
       " [32, 33, 97, 87, 89, 10, 99, 39],\n",
       " [33, 97, 39, 76, 9, 99, 39, 55],\n",
       " [97, 39, 38, 73, 87, 39, 55, 59],\n",
       " [39, 38, 80, 89, 76, 55, 59, 34],\n",
       " [38, 80, 60, 27, 73, 59, 34, 23],\n",
       " [80, 60, 21, 81, 89, 34, 23, 91],\n",
       " [60, 21, 32, 29, 27, 23, 91, 73],\n",
       " [21, 32, 90, 27, 81, 91, 73, 55],\n",
       " [32, 90, 1, 95, 29, 73, 55, 68],\n",
       " [90, 1, 97, 2, 27, 55, 68, 41],\n",
       " [1, 97, 26, 92, 95, 68, 41, 93],\n",
       " [97, 26, 64, 3, 2, 41, 93, 48],\n",
       " [26, 64, 60, 89, 92, 93, 48, 48],\n",
       " [64, 60, 3, 61, 3, 48, 48, 3],\n",
       " [60, 3, 31, 52, 89, 48, 3, 24],\n",
       " [3, 31, 18, 14, 61, 3, 24, 32],\n",
       " [31, 18, 60, 78, 52, 24, 32, 66],\n",
       " [18, 60, 71, 26, 14, 32, 66, 57],\n",
       " [60, 71, 64, 62, 78, 66, 57, 37],\n",
       " [71, 64, 87, 41, 26, 57, 37, 88],\n",
       " [64, 87, 30, 7, 62, 37, 88, 5],\n",
       " [87, 30, 72, 38, 41, 88, 5, 79],\n",
       " [30, 72, 93, 82, 7, 5, 79, 60],\n",
       " [72, 93, 20, 71, 38, 79, 60, 87],\n",
       " [93, 20, 1, 39, 82, 60, 87, 31],\n",
       " [20, 1, 8, 95, 71, 87, 31, 45],\n",
       " [1, 8, 94, 3, 39, 31, 45, 5],\n",
       " [8, 94, 43, 37, 95, 45, 5, 88],\n",
       " [94, 43, 88, 75, 3, 5, 88, 38],\n",
       " [43, 88, 58, 57, 37, 88, 38, 67],\n",
       " [88, 58, 81, 26, 75, 38, 67, 60],\n",
       " [58, 81, 3, 83, 57, 67, 60, 36],\n",
       " [81, 3, 35, 97, 26, 60, 36, 67],\n",
       " [3, 35, 59, 59, 83, 36, 67, 58],\n",
       " [35, 59, 77, 17, 97, 67, 58, 59],\n",
       " [59, 77, 11, 87, 59, 58, 59, 1],\n",
       " [77, 11, 80, 41, 17, 59, 1, 53],\n",
       " [11, 80, 33, 96, 87, 1, 53, 8],\n",
       " [80, 33, 70, 39, 41, 53, 8, 30],\n",
       " [33, 70, 92, 5, 96, 8, 30, 43],\n",
       " [70, 92, 17, 24, 39, 30, 43, 73],\n",
       " [92, 17, 6, 59, 5, 43, 73, 81],\n",
       " [17, 6, 64, 40, 24, 73, 81, 8],\n",
       " [6, 64, 84, 1, 59, 81, 8, 33],\n",
       " [64, 84, 76, 39, 40, 8, 33, 85],\n",
       " [84, 76, 43, 79, 1, 33, 85, 76],\n",
       " [76, 43, 39, 74, 39, 85, 76, 13],\n",
       " [43, 39, 58, 27, 79, 76, 13, 81],\n",
       " [39, 58, 8, 82, 74, 13, 81, 97],\n",
       " [58, 8, 89, 6, 27, 81, 97, 74],\n",
       " [8, 89, 97, 2, 82, 97, 74, 66],\n",
       " [89, 97, 39, 13, 6, 74, 66, 38],\n",
       " [97, 39, 49, 87, 2, 66, 38, 73],\n",
       " [39, 49, 28, 1, 13, 38, 73, 40],\n",
       " [49, 28, 65, 72, 87, 73, 40, 31],\n",
       " [28, 65, 50, 1, 1, 40, 31, 40],\n",
       " [65, 50, 91, 59, 72, 31, 40, 70],\n",
       " [50, 91, 10, 27, 1, 40, 70, 40],\n",
       " [91, 10, 28, 20, 59, 70, 40, 97],\n",
       " [10, 28, 53, 83, 27, 40, 97, 58],\n",
       " [28, 53, 91, 72, 20, 97, 58, 99],\n",
       " [53, 91, 58, 6, 83, 58, 99, 25],\n",
       " [91, 58, 49, 30, 72, 99, 25, 8],\n",
       " [58, 49, 24, 2, 6, 25, 8, 84],\n",
       " [49, 24, 26, 62, 30, 8, 84, 42],\n",
       " [24, 26, 20, 29, 2, 84, 42, 20],\n",
       " [26, 20, 49, 7, 62, 42, 20, 25],\n",
       " [20, 49, 98, 86, 29, 20, 25, 33],\n",
       " [49, 98, 77, 88, 7, 25, 33, 16],\n",
       " [98, 77, 76, 92, 86, 33, 16, 87],\n",
       " [77, 76, 94, 4, 88, 16, 87, 34],\n",
       " [76, 94, 31, 7, 92, 87, 34, 67],\n",
       " [94, 31, 32, 99, 4, 34, 67, 74],\n",
       " [31, 32, 29, 92, 7, 67, 74, 15],\n",
       " [32, 29, 80, 55, 99, 74, 15, 38],\n",
       " [29, 80, 85, 9, 92, 15, 38, 25],\n",
       " [80, 85, 22, 73, 55, 38, 25, 84],\n",
       " [85, 22, 85, 11, 9, 25, 84, 20],\n",
       " [22, 85, 47, 58, 73, 84, 20, 64],\n",
       " [85, 47, 47, 85, 11, 20, 64, 80],\n",
       " [47, 47, 46, 5, 58, 64, 80, 36],\n",
       " [47, 46, 95, 88, 85, 80, 36, 70],\n",
       " [46, 95, 85, 66, 5, 36, 70, 96],\n",
       " [95, 85, 21, 8, 88, 70, 96, 90],\n",
       " [85, 21, 50, 73, 66, 96, 90, 58],\n",
       " [21, 50, 34, 44, 8, 90, 58, 36],\n",
       " [50, 34, 3, 49, 73, 58, 36, 95],\n",
       " [34, 3, 98, 89, 44, 36, 95, 67],\n",
       " [3, 98, 98, 43, 49, 95, 67, 19],\n",
       " [98, 98, 99, 22, 89, 67, 19, 5],\n",
       " [98, 99, 13, 88, 43, 19, 5, 76],\n",
       " [99, 13, 83, 19, 22, 5, 76, 97],\n",
       " [13, 83, 78, 20, 88, 76, 97, 64],\n",
       " [83, 78, 67, 79, 19, 97, 64, 13],\n",
       " [78, 67, 38, 33, 20, 64, 13, 91],\n",
       " [67, 38, 32, 24, 79, 13, 91, 59],\n",
       " [38, 32, 57, 88, 33, 91, 59, 75],\n",
       " [32, 57, 82, 48, 24, 59, 75, 16],\n",
       " [57, 82, 88, 57, 88, 75, 16, 32],\n",
       " [82, 88, 0, 0, 48, 16, 32, 0],\n",
       " [0, 82, 56, 35, 0, 0, 63, 43],\n",
       " [82, 56, 98, 97, 48, 63, 43, 39],\n",
       " [56, 98, 75, 18, 35, 43, 39, 47],\n",
       " [98, 75, 16, 97, 97, 39, 47, 19],\n",
       " [75, 16, 80, 97, 18, 47, 19, 40],\n",
       " [16, 80, 81, 19, 97, 19, 40, 4],\n",
       " [80, 81, 39, 69, 97, 40, 4, 34],\n",
       " [81, 39, 56, 3, 19, 4, 34, 56],\n",
       " [39, 56, 50, 16, 69, 34, 56, 47],\n",
       " [56, 50, 91, 42, 3, 56, 47, 17],\n",
       " [50, 91, 3, 72, 16, 47, 17, 56],\n",
       " [91, 3, 71, 98, 42, 17, 56, 74],\n",
       " [3, 71, 98, 52, 72, 56, 74, 37],\n",
       " [71, 98, 6, 70, 98, 74, 37, 33],\n",
       " [98, 6, 73, 37, 52, 37, 33, 42],\n",
       " [6, 73, 30, 75, 70, 33, 42, 4],\n",
       " [73, 30, 20, 29, 37, 42, 4, 13],\n",
       " [30, 20, 26, 82, 75, 4, 13, 97],\n",
       " [20, 26, 16, 56, 29, 13, 97, 50],\n",
       " [26, 16, 55, 73, 82, 97, 50, 94],\n",
       " [16, 55, 97, 7, 56, 50, 94, 58],\n",
       " [55, 97, 83, 17, 73, 94, 58, 49],\n",
       " [97, 83, 57, 21, 7, 58, 49, 93],\n",
       " [83, 57, 42, 4, 17, 49, 93, 39],\n",
       " [57, 42, 91, 49, 21, 93, 39, 67],\n",
       " [42, 91, 27, 77, 4, 39, 67, 61],\n",
       " [91, 27, 75, 77, 49, 67, 61, 61],\n",
       " [27, 75, 9, 59, 77, 61, 61, 98],\n",
       " [75, 9, 93, 66, 77, 61, 98, 65],\n",
       " [9, 93, 33, 83, 59, 98, 65, 67],\n",
       " [93, 33, 72, 24, 66, 65, 67, 9],\n",
       " [33, 72, 88, 25, 83, 67, 9, 78],\n",
       " [72, 88, 69, 73, 24, 9, 78, 55],\n",
       " [88, 69, 87, 55, 25, 78, 55, 22],\n",
       " [69, 87, 15, 81, 73, 55, 22, 66],\n",
       " [87, 15, 36, 22, 55, 22, 66, 85],\n",
       " [15, 36, 85, 55, 81, 66, 85, 57],\n",
       " [36, 85, 38, 20, 22, 85, 57, 32],\n",
       " [85, 38, 63, 96, 55, 57, 32, 40],\n",
       " [38, 63, 68, 55, 20, 32, 40, 43],\n",
       " [63, 68, 15, 4, 96, 40, 43, 34],\n",
       " [68, 15, 38, 99, 55, 43, 34, 15],\n",
       " [15, 38, 58, 26, 4, 34, 15, 77],\n",
       " [38, 58, 79, 42, 99, 15, 77, 25],\n",
       " [58, 79, 35, 15, 26, 77, 25, 86],\n",
       " [79, 35, 52, 74, 42, 25, 86, 82],\n",
       " [35, 52, 51, 72, 15, 86, 82, 49],\n",
       " [52, 51, 51, 39, 74, 82, 49, 10],\n",
       " [51, 51, 86, 50, 72, 49, 10, 29],\n",
       " [51, 86, 15, 23, 39, 10, 29, 35],\n",
       " [86, 15, 53, 98, 50, 29, 35, 77],\n",
       " [15, 53, 31, 48, 23, 35, 77, 74],\n",
       " [53, 31, 82, 32, 98, 77, 74, 36],\n",
       " [31, 82, 11, 47, 48, 74, 36, 86],\n",
       " [82, 11, 62, 99, 32, 36, 86, 72],\n",
       " [11, 62, 24, 6, 47, 86, 72, 10],\n",
       " [62, 24, 2, 15, 99, 72, 10, 30],\n",
       " [24, 2, 29, 77, 6, 10, 30, 13],\n",
       " [2, 29, 59, 17, 15, 30, 13, 6],\n",
       " [29, 59, 11, 93, 77, 13, 6, 73],\n",
       " [59, 11, 12, 21, 17, 6, 73, 57],\n",
       " [11, 12, 2, 83, 93, 73, 57, 38],\n",
       " [12, 2, 83, 10, 21, 57, 38, 38],\n",
       " [2, 83, 35, 57, 83, 38, 38, 42],\n",
       " [83, 35, 12, 38, 10, 38, 42, 74],\n",
       " [35, 12, 47, 99, 57, 42, 74, 37],\n",
       " [12, 47, 75, 7, 38, 74, 37, 7],\n",
       " [47, 75, 37, 31, 99, 37, 7, 22],\n",
       " [75, 37, 7, 68, 7, 7, 22, 50],\n",
       " [37, 7, 64, 72, 31, 22, 50, 66],\n",
       " [7, 64, 61, 71, 68, 50, 66, 54],\n",
       " [64, 61, 4, 54, 72, 66, 54, 7],\n",
       " [61, 4, 51, 57, 71, 54, 7, 60],\n",
       " [4, 51, 60, 14, 54, 7, 60, 3],\n",
       " [51, 60, 35, 11, 57, 60, 3, 46],\n",
       " [60, 35, 22, 61, 14, 3, 46, 98],\n",
       " [35, 22, 17, 34, 11, 46, 98, 94],\n",
       " [22, 17, 19, 43, 61, 98, 94, 49],\n",
       " [17, 19, 62, 1, 34, 94, 49, 47],\n",
       " [19, 62, 55, 89, 43, 49, 47, 89],\n",
       " [62, 55, 61, 55, 1, 47, 89, 83],\n",
       " [55, 61, 22, 57, 89, 89, 83, 37],\n",
       " [61, 22, 88, 37, 55, 83, 37, 3],\n",
       " [22, 88, 84, 88, 57, 37, 3, 74],\n",
       " [88, 84, 72, 67, 37, 3, 74, 36],\n",
       " [84, 72, 17, 6, 88, 74, 36, 82],\n",
       " [72, 17, 68, 56, 67, 36, 82, 37],\n",
       " [17, 68, 39, 18, 6, 82, 37, 29],\n",
       " [68, 39, 28, 2, 56, 37, 29, 48],\n",
       " [39, 28, 97, 74, 18, 29, 48, 20],\n",
       " [28, 97, 88, 52, 2, 48, 20, 3],\n",
       " [97, 88, 99, 78, 74, 20, 3, 65],\n",
       " [88, 99, 90, 14, 52, 3, 65, 96],\n",
       " [99, 90, 17, 98, 78, 65, 96, 68],\n",
       " [90, 17, 83, 8, 14, 96, 68, 75],\n",
       " [17, 83, 20, 27, 98, 68, 75, 36],\n",
       " [83, 20, 97, 11, 8, 75, 36, 54],\n",
       " [20, 97, 51, 39, 27, 36, 54, 8],\n",
       " [97, 51, 89, 10, 11, 54, 8, 73],\n",
       " [51, 89, 9, 99, 39, 8, 73, 58],\n",
       " [89, 9, 87, 39, 10, 73, 58, 93],\n",
       " [9, 87, 76, 55, 99, 58, 93, 63],\n",
       " [87, 76, 73, 59, 39, 93, 63, 38],\n",
       " [76, 73, 89, 34, 55, 63, 38, 60],\n",
       " [73, 89, 27, 23, 59, 38, 60, 45],\n",
       " [89, 27, 81, 91, 34, 60, 45, 55],\n",
       " [27, 81, 29, 73, 23, 45, 55, 24],\n",
       " [81, 29, 27, 55, 91, 55, 24, 7],\n",
       " [29, 27, 95, 68, 73, 24, 7, 11],\n",
       " [27, 95, 2, 41, 55, 7, 11, 70],\n",
       " [95, 2, 92, 93, 68, 11, 70, 22],\n",
       " [2, 92, 3, 48, 41, 70, 22, 30],\n",
       " [92, 3, 89, 48, 93, 22, 30, 58],\n",
       " [3, 89, 61, 3, 48, 30, 58, 17],\n",
       " [89, 61, 52, 24, 48, 58, 17, 13],\n",
       " [61, 52, 14, 32, 3, 17, 13, 91],\n",
       " [52, 14, 78, 66, 24, 13, 91, 20],\n",
       " [14, 78, 26, 57, 32, 91, 20, 49],\n",
       " [78, 26, 62, 37, 66, 20, 49, 20],\n",
       " [26, 62, 41, 88, 57, 49, 20, 69],\n",
       " [62, 41, 7, 5, 37, 20, 69, 10],\n",
       " [41, 7, 38, 79, 88, 69, 10, 48],\n",
       " [7, 38, 82, 60, 5, 10, 48, 14],\n",
       " [38, 82, 71, 87, 79, 48, 14, 22],\n",
       " [82, 71, 39, 31, 60, 14, 22, 44],\n",
       " [71, 39, 95, 45, 87, 22, 44, 82],\n",
       " [39, 95, 3, 5, 31, 44, 82, 95],\n",
       " [95, 3, 37, 88, 45, 82, 95, 68],\n",
       " [3, 37, 75, 38, 5, 95, 68, 76],\n",
       " [37, 75, 57, 67, 88, 68, 76, 43],\n",
       " [75, 57, 26, 60, 38, 76, 43, 53],\n",
       " [57, 26, 83, 36, 67, 43, 53, 89],\n",
       " [26, 83, 97, 67, 60, 53, 89, 92],\n",
       " [83, 97, 59, 58, 36, 89, 92, 43],\n",
       " [97, 59, 17, 59, 67, 92, 43, 69],\n",
       " [59, 17, 87, 1, 58, 43, 69, 5],\n",
       " [17, 87, 41, 53, 59, 69, 5, 87],\n",
       " [87, 41, 96, 8, 1, 5, 87, 52],\n",
       " [41, 96, 39, 30, 53, 87, 52, 31],\n",
       " [96, 39, 5, 43, 8, 52, 31, 54],\n",
       " [39, 5, 24, 73, 30, 31, 54, 32],\n",
       " [5, 24, 59, 81, 43, 54, 32, 79],\n",
       " [24, 59, 40, 8, 73, 32, 79, 72],\n",
       " [59, 40, 1, 33, 81, 79, 72, 2],\n",
       " [40, 1, 39, 85, 8, 72, 2, 15],\n",
       " [1, 39, 79, 76, 33, 2, 15, 68],\n",
       " [39, 79, 74, 13, 85, 15, 68, 72],\n",
       " [79, 74, 27, 81, 76, 68, 72, 46],\n",
       " [74, 27, 82, 97, 13, 72, 46, 60],\n",
       " [27, 82, 6, 74, 81, 46, 60, 51],\n",
       " [82, 6, 2, 66, 97, 60, 51, 55],\n",
       " [6, 2, 13, 38, 74, 51, 55, 38],\n",
       " [2, 13, 87, 73, 66, 55, 38, 4],\n",
       " [13, 87, 1, 40, 38, 38, 4, 66],\n",
       " [87, 1, 72, 31, 73, 4, 66, 21],\n",
       " [1, 72, 1, 40, 40, 66, 21, 11],\n",
       " [72, 1, 59, 70, 31, 21, 11, 63],\n",
       " [1, 59, 27, 40, 40, 11, 63, 55],\n",
       " [59, 27, 20, 97, 70, 63, 55, 20],\n",
       " [27, 20, 83, 58, 40, 55, 20, 3],\n",
       " [20, 83, 72, 99, 97, 20, 3, 20],\n",
       " [83, 72, 6, 25, 58, 3, 20, 96],\n",
       " [72, 6, 30, 8, 99, 20, 96, 70],\n",
       " [6, 30, 2, 84, 25, 96, 70, 74],\n",
       " [30, 2, 62, 42, 8, 70, 74, 96],\n",
       " [2, 62, 29, 20, 84, 74, 96, 2],\n",
       " [62, 29, 7, 25, 42, 96, 2, 94],\n",
       " [29, 7, 86, 33, 20, 2, 94, 15],\n",
       " [7, 86, 88, 16, 25, 94, 15, 94],\n",
       " [86, 88, 92, 87, 33, 15, 94, 15],\n",
       " [88, 92, 4, 34, 16, 94, 15, 97],\n",
       " [92, 4, 7, 67, 87, 15, 97, 9],\n",
       " [4, 7, 99, 74, 34, 97, 9, 89],\n",
       " [7, 99, 92, 15, 67, 9, 89, 63],\n",
       " [99, 92, 55, 38, 74, 89, 63, 5],\n",
       " [92, 55, 9, 25, 15, 63, 5, 85],\n",
       " [55, 9, 73, 84, 38, 5, 85, 10],\n",
       " [9, 73, 11, 20, 25, 85, 10, 76],\n",
       " [73, 11, 58, 64, 84, 10, 76, 78],\n",
       " [11, 58, 85, 80, 20, 76, 78, 31],\n",
       " [58, 85, 5, 36, 64, 78, 31, 51],\n",
       " [85, 5, 88, 70, 80, 31, 51, 47],\n",
       " [5, 88, 66, 96, 36, 51, 47, 80],\n",
       " [88, 66, 8, 90, 70, 47, 80, 27],\n",
       " [66, 8, 73, 58, 96, 80, 27, 92],\n",
       " [8, 73, 44, 36, 90, 27, 92, 71],\n",
       " [73, 44, 49, 95, 58, 92, 71, 15],\n",
       " [44, 49, 89, 67, 36, 71, 15, 8],\n",
       " [49, 89, 43, 19, 95, 15, 8, 56],\n",
       " [89, 43, 22, 5, 67, 8, 56, 13],\n",
       " [43, 22, 88, 76, 19, 56, 13, 84],\n",
       " [22, 88, 19, 97, 5, 13, 84, 23],\n",
       " [88, 19, 20, 64, 76, 84, 23, 88],\n",
       " [19, 20, 79, 13, 97, 23, 88, 24],\n",
       " [20, 79, 33, 91, 64, 88, 24, 48],\n",
       " [79, 33, 24, 59, 13, 24, 48, 71],\n",
       " [33, 24, 88, 75, 91, 48, 71, 94],\n",
       " [24, 88, 48, 16, 59, 71, 94, 8],\n",
       " [88, 48, 57, 32, 75, 94, 8, 60],\n",
       " [48, 57, 0, 0, 16, 8, 60, 0],\n",
       " [0, 48, 35, 43, 0, 0, 28, 38],\n",
       " [48, 35, 97, 39, 63, 28, 38, 13],\n",
       " [35, 97, 18, 47, 43, 38, 13, 37],\n",
       " [97, 18, 97, 19, 39, 13, 37, 43],\n",
       " [18, 97, 97, 40, 47, 37, 43, 42],\n",
       " [97, 97, 19, 4, 19, 43, 42, 58],\n",
       " [97, 19, 69, 34, 40, 42, 58, 26],\n",
       " [19, 69, 3, 56, 4, 58, 26, 29],\n",
       " [69, 3, 16, 47, 34, 26, 29, 96],\n",
       " [3, 16, 42, 17, 56, 29, 96, 16],\n",
       " [16, 42, 72, 56, 47, 96, 16, 2],\n",
       " [42, 72, 98, 74, 17, 16, 2, 26],\n",
       " [72, 98, 52, 37, 56, 2, 26, 32],\n",
       " [98, 52, 70, 33, 74, 26, 32, 79],\n",
       " [52, 70, 37, 42, 37, 32, 79, 6],\n",
       " [70, 37, 75, 4, 33, 79, 6, 15],\n",
       " [37, 75, 29, 13, 42, 6, 15, 37],\n",
       " [75, 29, 82, 97, 4, 15, 37, 96],\n",
       " [29, 82, 56, 50, 13, 37, 96, 91],\n",
       " [82, 56, 73, 94, 97, 96, 91, 20],\n",
       " [56, 73, 7, 58, 50, 91, 20, 75],\n",
       " [73, 7, 17, 49, 94, 20, 75, 33],\n",
       " [7, 17, 21, 93, 58, 75, 33, 31],\n",
       " [17, 21, 4, 39, 49, 33, 31, 19],\n",
       " [21, 4, 49, 67, 93, 31, 19, 38],\n",
       " [4, 49, 77, 61, 39, 19, 38, 26],\n",
       " [49, 77, 77, 61, 67, 38, 26, 94],\n",
       " [77, 77, 59, 98, 61, 26, 94, 7],\n",
       " [77, 59, 66, 65, 61, 94, 7, 21],\n",
       " [59, 66, 83, 67, 98, 7, 21, 35],\n",
       " [66, 83, 24, 9, 65, 21, 35, 24],\n",
       " [83, 24, 25, 78, 67, 35, 24, 61],\n",
       " [24, 25, 73, 55, 9, 24, 61, 31],\n",
       " [25, 73, 55, 22, 78, 61, 31, 42],\n",
       " [73, 55, 81, 66, 55, 31, 42, 24],\n",
       " [55, 81, 22, 85, 22, 42, 24, 42],\n",
       " [81, 22, 55, 57, 66, 24, 42, 33],\n",
       " [22, 55, 20, 32, 85, 42, 33, 13],\n",
       " [55, 20, 96, 40, 57, 33, 13, 80],\n",
       " [20, 96, 55, 43, 32, 13, 80, 32],\n",
       " [96, 55, 4, 34, 40, 80, 32, 58],\n",
       " [55, 4, 99, 15, 43, 32, 58, 51],\n",
       " [4, 99, 26, 77, 34, 58, 51, 91],\n",
       " [99, 26, 42, 25, 15, 51, 91, 8],\n",
       " [26, 42, 15, 86, 77, 91, 8, 81],\n",
       " [42, 15, 74, 82, 25, 8, 81, 24],\n",
       " [15, 74, 72, 49, 86, 81, 24, 85],\n",
       " [74, 72, 39, 10, 82, 24, 85, 10],\n",
       " [72, 39, 50, 29, 49, 85, 10, 83],\n",
       " [39, 50, 23, 35, 10, 10, 83, 25],\n",
       " [50, 23, 98, 77, 29, 83, 25, 45],\n",
       " [23, 98, 48, 74, 35, 25, 45, 59],\n",
       " [98, 48, 32, 36, 77, 45, 59, 92],\n",
       " [48, 32, 47, 86, 74, 59, 92, 91],\n",
       " [32, 47, 99, 72, 36, 92, 91, 89],\n",
       " [47, 99, 6, 10, 86, 91, 89, 34],\n",
       " [99, 6, 15, 30, 72, 89, 34, 9],\n",
       " [6, 15, 77, 13, 10, 34, 9, 76],\n",
       " [15, 77, 17, 6, 30, 9, 76, 91],\n",
       " [77, 17, 93, 73, 13, 76, 91, 50],\n",
       " [17, 93, 21, 57, 6, 91, 50, 69],\n",
       " [93, 21, 83, 38, 73, 50, 69, 36],\n",
       " [21, 83, 10, 38, 57, 69, 36, 54],\n",
       " [83, 10, 57, 42, 38, 36, 54, 22],\n",
       " [10, 57, 38, 74, 38, 54, 22, 45],\n",
       " [57, 38, 99, 37, 42, 22, 45, 14],\n",
       " [38, 99, 7, 7, 74, 45, 14, 92],\n",
       " [99, 7, 31, 22, 37, 14, 92, 77],\n",
       " [7, 31, 68, 50, 7, 92, 77, 99],\n",
       " [31, 68, 72, 66, 22, 77, 99, 43],\n",
       " [68, 72, 71, 54, 50, 99, 43, 92],\n",
       " [72, 71, 54, 7, 66, 43, 92, 7],\n",
       " [71, 54, 57, 60, 54, 92, 7, 85],\n",
       " [54, 57, 14, 3, 7, 7, 85, 85],\n",
       " [57, 14, 11, 46, 60, 85, 85, 49],\n",
       " [14, 11, 61, 98, 3, 85, 49, 79],\n",
       " [11, 61, 34, 94, 46, 49, 79, 74],\n",
       " [61, 34, 43, 49, 98, 79, 74, 35],\n",
       " [34, 43, 1, 47, 94, 74, 35, 73],\n",
       " [43, 1, 89, 89, 49, 35, 73, 14],\n",
       " [1, 89, 55, 83, 47, 73, 14, 86],\n",
       " [89, 55, 57, 37, 89, 14, 86, 9],\n",
       " [55, 57, 37, 3, 83, 86, 9, 14],\n",
       " [57, 37, 88, 74, 37, 9, 14, 26],\n",
       " [37, 88, 67, 36, 3, 14, 26, 88],\n",
       " [88, 67, 6, 82, 74, 26, 88, 72],\n",
       " [67, 6, 56, 37, 36, 88, 72, 59],\n",
       " [6, 56, 18, 29, 82, 72, 59, 37],\n",
       " [56, 18, 2, 48, 37, 59, 37, 33],\n",
       " [18, 2, 74, 20, 29, 37, 33, 52],\n",
       " [2, 74, 52, 3, 48, 33, 52, 8],\n",
       " [74, 52, 78, 65, 20, 52, 8, 53],\n",
       " [52, 78, 14, 96, 3, 8, 53, 82],\n",
       " [78, 14, 98, 68, 65, 53, 82, 77],\n",
       " [14, 98, 8, 75, 96, 82, 77, 31],\n",
       " [98, 8, 27, 36, 68, 77, 31, 77],\n",
       " [8, 27, 11, 54, 75, 31, 77, 67],\n",
       " [27, 11, 39, 8, 36, 77, 67, 81],\n",
       " [11, 39, 10, 73, 54, 67, 81, 27],\n",
       " [39, 10, 99, 58, 8, 81, 27, 39],\n",
       " [10, 99, 39, 93, 73, 27, 39, 70],\n",
       " [99, 39, 55, 63, 58, 39, 70, 13],\n",
       " [39, 55, 59, 38, 93, 70, 13, 97],\n",
       " [55, 59, 34, 60, 63, 13, 97, 67],\n",
       " [59, 34, 23, 45, 38, 97, 67, 94],\n",
       " [34, 23, 91, 55, 60, 67, 94, 1],\n",
       " [23, 91, 73, 24, 45, 94, 1, 16],\n",
       " [91, 73, 55, 7, 55, 1, 16, 42],\n",
       " [73, 55, 68, 11, 24, 16, 42, 5],\n",
       " [55, 68, 41, 70, 7, 42, 5, 52],\n",
       " [68, 41, 93, 22, 11, 5, 52, 56],\n",
       " [41, 93, 48, 30, 70, 52, 56, 39],\n",
       " [93, 48, 48, 58, 22, 56, 39, 59],\n",
       " [48, 48, 3, 17, 30, 39, 59, 57],\n",
       " [48, 3, 24, 13, 58, 59, 57, 46],\n",
       " [3, 24, 32, 91, 17, 57, 46, 25],\n",
       " [24, 32, 66, 20, 13, 46, 25, 13],\n",
       " [32, 66, 57, 49, 91, 25, 13, 90],\n",
       " [66, 57, 37, 20, 20, 13, 90, 56],\n",
       " [57, 37, 88, 69, 49, 90, 56, 16],\n",
       " [37, 88, 5, 10, 20, 56, 16, 42],\n",
       " [88, 5, 79, 48, 69, 16, 42, 40],\n",
       " [5, 79, 60, 14, 10, 42, 40, 36],\n",
       " [79, 60, 87, 22, 48, 40, 36, 92],\n",
       " [60, 87, 31, 44, 14, 36, 92, 9],\n",
       " [87, 31, 45, 82, 22, 92, 9, 67],\n",
       " [31, 45, 5, 95, 44, 9, 67, 6],\n",
       " [45, 5, 88, 68, 82, 67, 6, 25],\n",
       " [5, 88, 38, 76, 95, 6, 25, 40],\n",
       " [88, 38, 67, 43, 68, 25, 40, 21],\n",
       " [38, 67, 60, 53, 76, 40, 21, 32],\n",
       " [67, 60, 36, 89, 43, 21, 32, 92],\n",
       " [60, 36, 67, 92, 53, 32, 92, 17],\n",
       " [36, 67, 58, 43, 89, 92, 17, 39],\n",
       " [67, 58, 59, 69, 92, 17, 39, 28],\n",
       " [58, 59, 1, 5, 43, 39, 28, 93],\n",
       " [59, 1, 53, 87, 69, 28, 93, 84],\n",
       " [1, 53, 8, 52, 5, 93, 84, 41],\n",
       " [53, 8, 30, 31, 87, 84, 41, 53],\n",
       " [8, 30, 43, 54, 52, 41, 53, 34],\n",
       " [30, 43, 73, 32, 31, 53, 34, 1],\n",
       " [43, 73, 81, 79, 54, 34, 1, 58],\n",
       " [73, 81, 8, 72, 32, 1, 58, 90],\n",
       " [81, 8, 33, 2, 79, 58, 90, 79],\n",
       " [8, 33, 85, 15, 72, 90, 79, 79],\n",
       " [33, 85, 76, 68, 2, 79, 79, 53],\n",
       " [85, 76, 13, 72, 15, 79, 53, 67],\n",
       " [76, 13, 81, 46, 68, 53, 67, 51],\n",
       " [13, 81, 97, 60, 72, 67, 51, 27],\n",
       " [81, 97, 74, 51, 46, 51, 27, 21],\n",
       " [97, 74, 66, 55, 60, 27, 21, 31],\n",
       " [74, 66, 38, 38, 51, 21, 31, 45],\n",
       " [66, 38, 73, 4, 55, 31, 45, 55],\n",
       " [38, 73, 40, 66, 38, 45, 55, 60],\n",
       " [73, 40, 31, 21, 4, 55, 60, 72],\n",
       " [40, 31, 40, 11, 66, 60, 72, 48],\n",
       " [31, 40, 70, 63, 21, 72, 48, 65],\n",
       " [40, 70, 40, 55, 11, 48, 65, 45],\n",
       " [70, 40, 97, 20, 63, 65, 45, 70],\n",
       " [40, 97, 58, 3, 55, 45, 70, 14],\n",
       " [97, 58, 99, 20, 20, 70, 14, 2],\n",
       " [58, 99, 25, 96, 3, 14, 2, 84],\n",
       " [99, 25, 8, 70, 20, 2, 84, 73],\n",
       " [25, 8, 84, 74, 96, 84, 73, 99],\n",
       " [8, 84, 42, 96, 70, 73, 99, 54],\n",
       " [84, 42, 20, 2, 74, 99, 54, 69],\n",
       " [42, 20, 25, 94, 96, 54, 69, 86],\n",
       " [20, 25, 33, 15, 2, 69, 86, 83],\n",
       " [25, 33, 16, 94, 94, 86, 83, 4],\n",
       " [33, 16, 87, 15, 15, 83, 4, 37],\n",
       " [16, 87, 34, 97, 94, 4, 37, 2],\n",
       " [87, 34, 67, 9, 15, 37, 2, 6],\n",
       " [34, 67, 74, 89, 97, 2, 6, 43],\n",
       " [67, 74, 15, 63, 9, 6, 43, 25],\n",
       " [74, 15, 38, 5, 89, 43, 25, 80],\n",
       " [15, 38, 25, 85, 63, 25, 80, 97],\n",
       " [38, 25, 84, 10, 5, 80, 97, 27],\n",
       " [25, 84, 20, 76, 85, 97, 27, 17],\n",
       " [84, 20, 64, 78, 10, 27, 17, 37],\n",
       " [20, 64, 80, 31, 76, 17, 37, 70],\n",
       " [64, 80, 36, 51, 78, 37, 70, 50],\n",
       " [80, 36, 70, 47, 31, 70, 50, 83],\n",
       " [36, 70, 96, 80, 51, 50, 83, 65],\n",
       " [70, 96, 90, 27, 47, 83, 65, 22],\n",
       " [96, 90, 58, 92, 80, 65, 22, 83],\n",
       " [90, 58, 36, 71, 27, 22, 83, 35],\n",
       " [58, 36, 95, 15, 92, 83, 35, 16],\n",
       " [36, 95, 67, 8, 71, 35, 16, 59],\n",
       " [95, 67, 19, 56, 15, 16, 59, 37],\n",
       " [67, 19, 5, 13, 8, 59, 37, 59],\n",
       " [19, 5, 76, 84, 56, 37, 59, 96],\n",
       " [5, 76, 97, 23, 13, 59, 96, 30],\n",
       " [76, 97, 64, 88, 84, 96, 30, 55],\n",
       " [97, 64, 13, 24, 23, 30, 55, 43],\n",
       " [64, 13, 91, 48, 88, 55, 43, 11],\n",
       " [13, 91, 59, 71, 24, 43, 11, 83],\n",
       " [91, 59, 75, 94, 48, 11, 83, 81],\n",
       " [59, 75, 16, 8, 71, 83, 81, 43],\n",
       " [75, 16, 32, 60, 94, 81, 43, 51],\n",
       " [16, 32, 0, 0, 8, 43, 51, 0],\n",
       " ...]"
      ]
     },
     "execution_count": 167,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#map:整合目标值和周边的值，越界的用0来代替\n",
    "#key:目标点的值\n",
    "#value:周围点的值的列表\n",
    "def map_matrix(target_matrix):\n",
    "    map_list = []\n",
    "    for i in range(target_matrix.shape[0]):\n",
    "        for j in range(target_matrix.shape[1]):\n",
    "#             map_dict = {}\n",
    "#             map_dict[str(i)+'_'+str(j)] = get_around_spot_value(i,j,target_matrix)\n",
    "            map_list.append(get_around_spot_value(i,j,target_matrix))\n",
    "    return map_list\n",
    "map_matrix(target_matrix)\n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[11.75 , 24.25 , 21.   , ..., 39.25 , 46.875, 27.375],\n",
       "       [24.875, 51.375, 52.625, ..., 62.75 , 66.875, 37.375],\n",
       "       [27.125, 59.875, 50.5  , ..., 49.125, 61.875, 33.25 ],\n",
       "       ...,\n",
       "       [36.75 , 54.875, 66.875, ..., 45.75 , 37.   , 31.5  ],\n",
       "       [42.125, 58.5  , 63.   , ..., 66.5  , 40.75 , 32.875],\n",
       "       [18.   , 35.125, 46.875, ..., 40.5  , 20.75 , 22.75 ]])"
      ]
     },
     "execution_count": 172,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#遍历求平均值\n",
    "def reduct_matrix(map_list,x,y,is_to_array = True):\n",
    "    average_matrix = []\n",
    "    for i in map_list:\n",
    "        average_matrix.append(np.mean(i))\n",
    "    if is_to_array:\n",
    "        average_matrix = np.array(average_matrix).reshape(x,y)\n",
    "    return average_matrix\n",
    "average_matrix = reduct_matrix(map_matrix(target_matrix),target_matrix.shape[0],target_matrix.shape[1])\n",
    "average_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 200)"
      ]
     },
     "execution_count": 173,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "average_matrix.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1. 1. 1.]\n",
      " [1. 1. 1.]\n",
      " [1. 1. 1.]]\n",
      "[[0. 0. 0. 0. 0.]\n",
      " [0. 1. 1. 1. 0.]\n",
      " [0. 1. 1. 1. 0.]\n",
      " [0. 1. 1. 1. 0.]\n",
      " [0. 0. 0. 0. 0.]]\n"
     ]
    }
   ],
   "source": [
    "#https://www.cnblogs.com/hezhiyao/p/8177541.html\n",
    "a = np.ones([3,3])\n",
    "print(a)\n",
    "ndarray = np.pad(a,((1,1)))\n",
    "print(ndarray)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
